﻿<UserControl
	x:Class="DeltaEngine.Editor.AppBuilder.BuiltAppsListView"
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="800"
	xmlns:local="clr-namespace:DeltaEngine.Editor.AppBuilder"
	xmlns:gl="clr-namespace:System.Globalization;assembly=mscorlib"
	d:DataContext="{d:DesignInstance local:DemoBuiltAppsListForDesigner, IsDesignTimeCreatable=true}"
>

	<UserControl.Resources>

		<Style TargetType="Label" x:Key="DeltaLabel">
			<Setter Property="FontSize" Value="14" />
			<Setter Property="FontFamily" Value="Arial" />
			<Setter Property="FontStyle" Value="Normal" />
			<Setter Property="Background" Value="#e2e2e2" />
			<Setter Property="Foreground" Value="#FF5D5D5D" />
			<Setter Property="Padding" Value="4,6,0,0" />
		</Style>

		<Style TargetType="Button" x:Key="DeltaButton">
			<Setter Property="FontSize" Value="14" />
			<Setter Property="FontFamily" Value="Arial" />
			<Setter Property="FontStyle" Value="Normal" />
			<Setter Property="Background">
				<Setter.Value>
					<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
						<GradientStop Color="#FFBBBBBB" Offset="0"/>
						<GradientStop Color="#FF9E9E9E" Offset="1"/>
					</LinearGradientBrush>
				</Setter.Value>
			</Setter>
			<Setter Property="BorderBrush" Value="Black" />
			<Setter Property="Foreground" Value="#FFFFFFFF" />
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="Button">
						<Border Background="{TemplateBinding Background}">
							<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
						</Border>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
			<Style.Triggers>
				<Trigger Property="IsEnabled" Value="False">
					<Setter Property="Background" Value="#FFCFCFCF" />
				</Trigger>
				<MultiDataTrigger>
					<MultiDataTrigger.Conditions>
						<Condition
Binding="{Binding RelativeSource={RelativeSource Self}, Path=IsMouseOver}" Value="True" />
						<Condition
Binding="{Binding RelativeSource={RelativeSource Self}, Path=IsEnabled}" Value="True" />
					</MultiDataTrigger.Conditions>
					<Setter Property="Background" Value="#7894d3" />
				</MultiDataTrigger>
			</Style.Triggers>
		</Style>

	</UserControl.Resources>

	<Border BorderThickness="1" BorderBrush="Gray">
	<ScrollViewer VerticalScrollBarVisibility="Visible" Background="White">
		<ItemsControl Name="AppListControl" ItemsSource="{Binding Path=BuiltApps, Mode=OneWay}">
			<ItemsControl.ItemTemplate>
				<DataTemplate>
					<Grid>
						<Grid.ColumnDefinitions>
							<ColumnDefinition Width="32" />
							<ColumnDefinition Width="8" />
							<ColumnDefinition Width="2*" />
							<ColumnDefinition Width="26" />
							<ColumnDefinition Width="6" />
							<ColumnDefinition Width="*" />
							<ColumnDefinition Width="8" />
							<ColumnDefinition Width="160" />
							<ColumnDefinition Width="100" />
							<ColumnDefinition Width="12" />
							<ColumnDefinition Width="100" />
						</Grid.ColumnDefinitions>
						<Image
							Source="/DeltaEngine.Editor;component/Images/AppBuilder/BuildInfoIcon.png" Grid.Column="0" />
						<TextBlock
							Name="AppName" Text="{Binding Path=Name}" FontSize="14"
							VerticalAlignment="Center" Grid.Column="2" />
						<TextBlock
							Name="PlatformName" Text="{Binding Path=Platform}" FontSize="14"
							VerticalAlignment="Center" HorizontalAlignment="Left" Grid.Column="5" />
						<Image
							Name="PlatformIcon2"
							Source="{Binding Path=PlatformIcon}"
							VerticalAlignment="Center" HorizontalAlignment="Center" Grid.Column="3"
						/>
						<TextBlock
							Name="BuildDate" FontSize="14" VerticalAlignment="Center" Grid.Column="7"
							Text="{Binding Path=BuildDate, ConverterCulture={x:Static gl:CultureInfo.CurrentCulture}}"
							HorizontalAlignment="Center"
						/>
						<Button
							Name="RebuildAppButton" Content="Rebuild" FontSize="14" Height="30" Grid.Column="8"
							Style="{StaticResource DeltaButton}" IsEnabled="{Binding Path=IsSolutionPathAvailable}"
							Click="OnRebuildAppClicked"
						/>
						<!--<ComboBox
							Name="DevicesComboBox" FontSize="14" Height="30" Grid.Column="7"
							ItemsSource="{Binding Path=AvailableDevices}" SelectedIndex="0"
							DisplayMemberPath="Name" HorizontalContentAlignment="Center"
						/>-->
						<Button
							Name="LaunchAppButton" Content="Launch" FontSize="14" Height="30" Grid.Column="10"
							Style="{StaticResource DeltaButton}" Click="OnLaunchAppClicked" />
					</Grid>
				</DataTemplate>
			</ItemsControl.ItemTemplate>
		</ItemsControl>
	</ScrollViewer>
	</Border>
</UserControl>